//createStar(2,20,x,y,att1,-1,spr_avoidance_cherry,1)
//speed,num,x,y,obj,dir,spr,image_index
//chatgpt so good
var a,i,j,dir,n,v,vv,ddd,k,rx,ry,r,v2,d,ddd2;

n = argument1-1

if(argument5==-2){dir=point_direction(argument2,argument3,player.x,player.y)}
else if(argument5==-1){dir=random(360)}
else{dir=argument5}



for(j=1;j<=5;j+=1;){

v=argument0;
ddd = degtorad(((180-((360/(5/2))))/2))
ddd2 = degtorad(((180-((360/5)))/2))
k=(2*v*cos(ddd2))*((1+sqrt(5))/2)
a=instance_create(argument2,argument3,argument4);
a.speed = argument0;
if(argument6!=0)
a.sprite_index = argument6;
if(argument7!=0)
a.image_index = argument7;
a.direction=dir;

for(i=1;i<n;i+=1;){
    a=instance_create(argument2,argument3,argument4)
    a.speed =abs(sqrt(sqr(v)+sqr(k*i/n)-2*v*(k*i/n)*cos(ddd)))
    vv=a.speed;
    a.direction=dir+radtodeg(arccos((sqr(v)+sqr(vv)-sqr(k*i/n))/(2*v*(vv))))
    if(argument6!=0)
    a.sprite_index = argument6;
    if(argument7!=0)
    a.image_index = argument7;
    if(i==n-1){
        dir += 360/5
    }
}
}
